import request from '@/utils/request';

// 获取表单列表
export function formList(queryParams) {
  return request({
    url: '/api/form/formList',
    method: 'post',
    data: queryParams
  });
}
//获取表单应用列表
export function formApplicationList(queryParams) {
  return request({
    url: '/api/form/formApplicationList',
    method: 'post',
    data: queryParams
  });
}
//发布表单表单
export function setFormMenu(queryParams) {
  return request({
    url: '/api/form/setFormMenu',
    method: 'post',
    data: queryParams
  });
}
export function getFormAppSetting(id) {
  const queryParams={
    id:id
  }
  return request({
    url: '/api/form/getFormAppSetting',
    method: 'get',
    params:queryParams
  });
}
export function depeteFormMenu(queryParams) {
  return request({
    url: '/api/form/depeteFormMenu',
    method: 'post',
    data:queryParams
  });
}
// 获取表单分类
export function formSortList() {
  return request({
    url: '/api/form/formSortList',
    method: 'get'
  });
}
// 获取表单树
export function getFormTree() {
  return request({
    url: '/api/form/getFormTree',
    method: 'get'
  });
}
// 获取表单树
export function getFormTreeByAdd() {
  return request({
    url: '/api/form/getFormTreeByAdd',
    method: 'get'
  });
}
// 删除表单
export function deleteForm(queryParams) {
  return request({
    url: '/api/form/deleteForm',
    method: 'post',
    data: queryParams
  });
}

export function editForm(queryParams) {
  return request({
    url: '/api/form/editForm',
    method: 'post',
    data: queryParams
  });
}
// 增加表单分类
export function addFormSort(queryParams) {
  return request({
    url: '/api/form/addFormSort',
    method: 'post',
    data: queryParams
  });
}

// 保存表单分类
export function updateFormSort(queryParams) {
  return request({
    url: '/api/form/updateFormSort',
    method: 'post',
    data: queryParams
  });
}

// 获取表单信息
export function getFormEntity(queryParams) {
  return request({
    url: '/api/form/getFormEntity',
    method: 'get',
    params: queryParams
  });
}
// 获取表单应用数据
export function getApplicationData(approval) {
  return request({
    url: '/api/formData/getApplicationData',
    method: 'post',
    data: approval
  });
}
// 根据表单id，获取数据
export function getDataById(approval) {
  return request({
    url: '/api/formData/getDataById',
    method: 'post',
    data: approval
  });
}
// 删除表单分类
export function deleteFormSort(approval) {
  return request({
    url: '/api/form/deleteFormSort',
    method: 'post',
    data: approval
  });
}
// 获取表单数据信息
export function getGenerWork(data) {
  return request({
    url: '/api/form/getGenerWork',
    method: 'get',
    params: data
  });
}
// 删除表单数据
export function deleteGenerWork(data) {
  return request({
    url: '/api/form/deleteGenerWork',
    method: 'post',
    data: data
  });
}

